﻿#region Using directives

using System;
using System.Collections.Generic;
using System.Text;

#endregion

namespace MetaHeuristics.Tests.Aco.Collections
{
    using MetaHeuristics.Aco.Collections;
    using MbUnit.Core.Framework;
    using MbUnit.Framework;

    [TestFixture]
    public class TourCollectionTest
    {
        [Test]
        public void Constructor()
        {
            TourCollection tour = new TourCollection();
        }

        [Test]
        public void Clone()
        {
            TourCollection tour = new TourCollection();
            tour.Length = 1;
            tour.Add(1);
            tour.Add(2);

            TourCollection clone = new TourCollection(tour);

            Assert.AreEqual(tour.Length, clone.Length);
            CollectionAssert.AreCountEqual(tour, clone);
            CollectionAssert.AreElementsEqual(tour, clone);
        }

        [Test]
        public void Length()
        {
            TourCollection tour = new TourCollection();
            tour.Length = 1;
            Assert.AreEqual(1, tour.Length);
        }

        [Test]
        public void AddAndCheckCount()
        {
            TourCollection tour = new TourCollection();
            tour.Add(10);
            Assert.AreEqual(1, tour.Count);
        }

        [Test]
        public void AddAndCheckFirst()
        {
            TourCollection tour = new TourCollection();
            tour.Add(10);
            Assert.AreEqual(10, tour[0]);
        }

        [Test]
        public void AddAndCheckContains()
        {
            TourCollection tour = new TourCollection();
            tour.Add(10);
            Assert.IsTrue(tour.Contains(10));
        }
    }
}
